<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
 
<!DOCTYPE>
<html>
<head>
<title>连接数监测</title>
<script src="media/js/jquery-1.10.1.min.js" type="text/javascript"></script>
</head>
<body>
	<div style="padding: 20px;">
		<!-- connect -->
		<div class="portlet box blue">
			<div class="portlet-title">
				<div class="caption">
					<i class="icon-cogs"></i>数据库连接数监测
				</div>
				<div class="tools">
					<a href="javascript:;" class="reload"></a>
				</div>
			</div>
			<div class="portlet-body">
				<table class="table table-hover">
					<thead>
						<tr>
							<th>连接名</th>
							<th>主机</th>
							<th>活跃连接</th>
							<th>最大连接数</th>
							<th>预警值</th>							
							<th>监测状态</th>
						</tr>
					</thead>					
					<tbody>
						<c:forEach items="${clist}" var="node">  
					        <tr>
					        	<th>${node.sname}</th>
					        	<th>${node.ip}</th>
					        	<th>${node.active}</th>
					        	<th>${node.max}</th>
					        	<th>${node.warn}%</th>
					        	
					        	<c:if test="${node.acive*100/node.max<=node.warn}">
					        		<td><span class="label label-success">正常</span></td>
					        	</c:if>
					        	<c:if test="${node.acive*100/node.max>node.warn}">
					        		<td><span class="label label-warning">异常</span></td>
					        	</c:if>
					        	
					        </tr>
					    </c:forEach> 
					</tbody>					
				</table>
			</div>
		</div>
		
	</div>
	
	<script>
		$('#li_db').addClass('active open');
		$('#cnmonitor').addClass('active');
	</script>
</body>
</html>